<me:UIABF x:Class="WPFExcelReport.TAB10"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport" 
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"
                    xmlns:LS="clr-namespace:WPFExcelReport;assembly=TLIEFDAT"  
                    xmlns:SD="clr-namespace:WPFExcelReport;assembly=TSDDAT"  
                    xmlns:AP="clr-namespace:WPFExcelReport;assembly=TAPKOPF"  
                    xmlns:AM="clr-namespace:WPFExcelReport;assembly=TAMSTAMM"  
                         xmlns:AE="clr-namespace:WPFExcelReport;assembly=TABARTE" 
                    xmlns:KSL="clr-namespace:WPFExcelReport;assembly=TKSLEIST" 
                   xmlns:AMV="clr-namespace:WPFExcelReport;assembly=TAMVALUE" 
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization" 
                    x:Name="TV"
                    Loaded="Window_Loaded"
     >
    <me:UIABF.Resources>
        <CollectionViewSource   x:Key="vwMaster" />
        <ucd:PNumConverter x:Key="pnum"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:NOTBoolToVisibilityConverter x:Key="nbv"/>
        <ucd:NOTConverter x:Key="not"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby480  x:Key="shift"/>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby10000 x:Key="dw"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:LSCONV x:Key="lsc"/>
    </me:UIABF.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*"/>
            <ColumnDefinition Width="1*"/>
        </Grid.ColumnDefinitions>
        <WrapPanel Grid.Row="0" Grid.Column="0">
            <LS:TSLS02 Visibility="Collapsed"/>
        </WrapPanel>
        <DataGrid  Grid.Row="1"  Grid.Column="0"  CanUserReorderColumns="True"  
                          CanUserResizeRows="True" CanUserSortColumns="True"                  
                          AutoGenerateColumns="False"   
                          EnableRowVirtualization="True"  
                          RowDetailsVisibilityMode="VisibleWhenSelected" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                          IsSynchronizedWithCurrentItem="True" Visibility="Visible"
                          ItemsSource="{Binding Source={StaticResource ResourceKey=vwMaster}}"  
                          x:Name="dlgMaster" 
                  >
            <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding Path=ABFAUFKRS}" Header=" "  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABFAUFLFD, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=生产单}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABFAUFPOS, Converter={StaticResource ResourceKey=pnum}}" Header=" "  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABFAFOLGE}" Header="{Binding Source={Localization:Translate Word=步骤}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABFISTARTDAT}" Header="{Binding Source={Localization:TranslateExtension Word= 开始}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABFISTARTZT}" Header="{Binding Source={Localization:TranslateExtension Word=时间}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABFMTYP }" Header="{Binding Source={Localization:Translate Word=设备类型}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABFLIEFNR,Converter={StaticResource lsc},ConverterParameter=LS02 }" Header="{Binding Source={Localization:Translate Word=外协}}"  Width="Auto" />                
                <DataGridTextColumn Binding="{Binding Path=ABFAGANG, Converter={StaticResource ResourceKey=gb2312}}" Header="{Binding Source={Localization:Translate Word=操作 }}"  Width="60" />
                <DataGridTextColumn Binding="{Binding Path=ABFBZAGANG, Converter={StaticResource ResourceKey=gb2312}}" Header="{Binding Source={Localization:Translate Word=操作}}"  Width="60" />
                <DataGridTextColumn Binding="{Binding Path=ABFMNRKRS}" Header=" "  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABFMLFDNR}" Header="{Binding Source={Localization:Translate Word=机台}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABFMPOS}" Header=" "  Width="Auto" />
            </DataGrid.Columns>
        </DataGrid  >
        <TabControl Grid.Row="1" Grid.Column="1">
            <TabItem Header="{Binding Source={Localization:Translate Word=步骤管理}}">
                <StackPanel Grid.Row="0" Grid.Column="0">
                    <WrapPanel>
                        <Button  Width="24" Height="20"   Margin="10,0,0,0"  Click="EditCommand" Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource nbv}}">
                            <Button.Background>
                                <ImageBrush  ImageSource="/ImagePackage;component/Images/Edit.png" />
                            </Button.Background>
                        </Button>
                        <Button  Width="24" Height="20"   Margin="10,0,0,0"  Click="SaveCommand" Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource bv}}">
                            <Button.Background>
                                <ImageBrush  ImageSource="/ImagePackage;component/Images/Save.png" />
                            </Button.Background>
                        </Button>
                        <Button  Width="24" Height="20"   Margin="10,0,0,0"  Click="NewCommand">
                            <Button.Background>
                                <ImageBrush  ImageSource="/ImagePackage;component/Images/Add.png" />
                            </Button.Background>
                        </Button>
                        <Button  Width="24" Height="20"   Margin="10,0,0,0"  Click="RefreshCommand" Visibility="Collapsed">
                            <Button.Background>
                                <ImageBrush  ImageSource="/ImagePackage;component/Images/Refresh.png" />
                            </Button.Background>
                        </Button>
                    </WrapPanel>
                    <WrapPanel Visibility="Collapsed">
                        <TextBlock   Width="Auto"  Margin="0,0,0,0" Text="{Binding Source={Localization:Translate Word=生产单}}" />
                        <ex:TXT72   MaxLength="2" Text="{Binding KRS,ElementName=TV}" Width="40" />
                        <ex:TXT72  MaxLength="6" Text="{Binding LFD,ElementName=TV}" Width="60"/>
                        <ex:TXT72   MaxLength="3" Text="{Binding POS,ElementName=TV}" Width="60"/>
                        <Button  Width="24" Height="20"   Margin="10,0,0,0"  Click="QueryCommand">
                            <Button.Background>
                                <ImageBrush  ImageSource="/ImagePackage;component/Images/Search.png" />
                            </Button.Background>
                        </Button>
                    </WrapPanel>
                    <WrapPanel>
                        <TextBlock    VerticalAlignment="Center" Text="{Binding Source={Localization:TranslateExtension Word=成本中心}}"></TextBlock>
                        <ex:TXT72   PRE="  " MaxLength="2" Text="{Binding KSTKRS,ElementName=TV}" Width="30" />
                        <ex:TXT72   PRE="0000" MaxLength="4" Text="{Binding KST,ElementName=TV}" Width="40"/>
                        <ex:TXT72  PRE="               "  MaxLength="15" Text="{Binding AGANG,ElementName=TV}" Width="80"/>
                        <ex:TXT72   PRE="        " MaxLength="8" Text="{Binding MTYP,ElementName=TV}" Width="60"/>
                    </WrapPanel>
                    <TextBlock Text="{Binding INFO}"></TextBlock>
                    <WrapPanel>
                        <TextBlock Text="{Binding Source={Localization:Translate Word=速度:}}"/>
                        <ex:NumericBox  Text="{Binding ABFBASMGE,Converter={StaticResource d1000}}" IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}" Width="40"/>
                        <SD:K9320 KEY="{Binding ABFME,ElementName=TV}"
                          IsEdit="{Binding IsEdit,ElementName=TV}"/>
                        <ex:NumericBox  Text="{Binding ABFME}" IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}" Width="40"/>
                        <ex:NumericBox  Text="{Binding ABFMASCHANZ,Converter={StaticResource dw}}" IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}" Width="40"/>
                        <SD:K0514 KEY="{Binding ABFMASCHZE,ElementName=TV}"
                          IsEdit="{Binding IsEdit,ElementName=TV}"/>
                        <ex:TXT72  Text="{Binding ABFMASCHZE}" IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}" Width="40"/>
                        <ex:NumericBox  Text="{Binding ABFMASCHZT,Converter={StaticResource d100}}" IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}" Width="40"/>
                    </WrapPanel>
                    <WrapPanel>
                        <AM:TSAM02 
                    KSTKRS="  "
                    KST="0500"
                    AMTYP="PCN     "
                    KEY="{Binding MACHINE,ElementName=TV}"/>
                    </WrapPanel>
                </StackPanel>
            </TabItem>
            <TabItem Header="{Binding Source={Localization:Translate Word=工艺参数}}">
                <AE:TRABE  Grid.Row="1"  Grid.Column="0"
                                   VU1="{Binding VU1,ElementName=TV}"
                                   IsEdit="{Binding IsEdit,ElementName=TV}" 
                                 EXAUF="{Binding KEY,ElementName=TV}"/>
            </TabItem>
            <TabItem Header="{Binding Source={Localization:Translate Word=作业进度}}">
                <KSL:TAV11 Grid.Row="0" Grid.Column="1" Name="cKSL" EXAUF="{Binding KEY,ElementName=TV}"/>
            </TabItem>
            <TabItem Header="{Binding Source={Localization:Translate Word=实际参数}}">
                <AMV:TAMV03 Grid.Row="1" Grid.Column="1" EXAUF="{Binding AMVKEY,ElementName=cKSL}"/>
            </TabItem>  
        </TabControl> 
    </Grid>

</me:UIABF>
